Page({
  goDetail(ev) {
    console.log(ev.currentTarget.dataset.id)
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index?id=' + ev.currentTarget.dataset.id,
    })
  },
  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
  data: {
    list: [],
    isEmpty: false,
  },
  onShow() {
    this.getRepairList()
  },
  // 获取报修列表
  async getRepairList() {
    const {
      data: { rows: list },
    } = await wx.http.get('/repair', { current: 1, pageSize: 10 })
    this.setData({ list, isEmpty: list.length === 0 })
  },
})
